import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";

Vue.use(VueRouter);

const routes = [
	{
		path: "/",
		name: "Home",
		component: Home,
	},

	{
		path: "/about",
		name: "About",
		component: () => import("../views/About.vue"),
	},
	
	{
		path: "/admin",
		name: "Admin",
		component: () => import("../views/Admin.vue"),
		
		children:[
			{
				path: "article",
				name: "AdminArticle",
				component: () => import("../views/admin/article/Article.vue"),
			},
			{
				path: "articleDetail",
				name: "AdminArticleDetail",
				component: () => import("../views/admin/article/ArticleDetail.vue"),
			},
			{
				path: "articleNew",
				name: "AdminArticleNew",
				component: () => import("../views/admin/article/ArticleNew.vue"),
			},
			{
				path: "articleUpdate",
				name: "AdminArticleUpdate",
				component: () => import("../views/admin/article/ArticleUpdate.vue"),
			},
			
		]
	}
];

const router = new VueRouter({
	mode: "history",
	base: process.env.BASE_URL,
	routes,
});

export default router;
